﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site/Master/Base.Master" AutoEventWireup="true" CodeBehind="Carrinho.aspx.cs" Inherits="ByBikeShop.Cliente.Pages.Carrinho" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
	<link href="/Cliente/Styles/cssCarrinho.min.css" rel="stylesheet" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Conteudo" runat="server">

	<section id="sectionPageCarrinho">
		<h1 style="text-align: left">Meu Carrinho
		</h1>
		<asp:UpdatePanel runat="server" ID="updCarrinho">
			<ContentTemplate>
				<section id="sectionCarrinho">
					<asp:GridView runat="server" ID="grdCarrinho" ClientIDMode="Static" GridLines="None" OnRowDataBound="grdCarrinho_RowDataBound"
						AutoGenerateColumns="false" OnRowCommand="grdCarrinho_RowCommand" EmptyDataText="Não há itens no seu carrinho!">
						<Columns>
							<asp:TemplateField ItemStyle-Width="20px" HeaderText="Produto">
								<ItemTemplate>
									<asp:Image runat="server" ImageUrl='<%# Eval("ImagemProduto") %>' />
								</ItemTemplate>
							</asp:TemplateField>

							<asp:BoundField DataField="NomeProduto" />

							<asp:TemplateField HeaderText="Quantidade" ItemStyle-HorizontalAlign="Center">
								<ItemTemplate>
									<asp:HiddenField runat="server" ID="hdfID" Value='<%# Eval("ID") %>' />
									<asp:DropDownList runat="server" ID="ddlQuantidade" OnSelectedIndexChanged="ddlQuantidade_SelectedIndexChanged"
										CssClass="Textbox ddlQuantidade" Width="100px" AutoPostBack="true" ToolTip='<%# Eval("ID") %>' ClientIDMode="Static">
									</asp:DropDownList>
								</ItemTemplate>
							</asp:TemplateField>

							<asp:BoundField DataField="precoUnitario" HeaderText="Preço" ItemStyle-HorizontalAlign="Center" />

							<asp:BoundField DataField="descontoUnitario" HeaderText="Desconto" ItemStyle-HorizontalAlign="Center" />

							<asp:BoundField DataField="precoTotal" HeaderText="Total" ItemStyle-HorizontalAlign="Center" />

							<asp:ButtonField ButtonType="Link" CommandName="remover" Text="remover" />
						</Columns>
					</asp:GridView>

					<article id="articleTotalCarrinho">
						Total: R$
						<asp:Label runat="server" ID="lblTotal" ClientIDMode="Static"></asp:Label>
						<br />
						<br />
						<asp:Button runat="server" ID="btnContinuarComprando" Text="Continuar Comprando" OnClick="btnContinuarComprando_Click" ClientIDMode="Static" />
						<asp:Button runat="server" ID="btnFinalizarCompra" Text="Finalizar Compra" OnClick="btnFinalizarCompra_Click" ClientIDMode="Static" />
					</article>
				</section>
			</ContentTemplate>
			<Triggers>
			</Triggers>
		</asp:UpdatePanel>
	</section>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="Scripts" runat="server">
	<script>
		$(document).ready(function () {
			var top = $('#sectionPageCarrinho').offset().top;
			top = top - 50;
			$('body').scrollTop(top);

		});
	</script>
</asp:Content>
